home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DRIVES.SWG / 0010_DRIVES5.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  61 lines

  1. {
  2. Author : MARCO MILTENBURG
  3.  
  4. Here's an overview of INT13h, Function 8 :
  5.  
  6. Name  : Get drive parameters
  7.  
  8. Input : AH = 08h
  9.         DL = <drive>   00h - 7Fh : Floppy disk
  10.                        80h - FFh : Harddisk
  11.  
  12. Output: if succesfull
  13.         -------------
  14.         Carry is cleared
  15.         BL = <driveType>    01 : 360 KBytes, 40 tracks, 5.25 Inch
  16.                             02 : 1,2 MBytes, 80 tracks, 5.25 Inch
  17.                             03 : 720 KBytes, 80 tracks, 3.5 Inch
  18.                             04 : 1,44 MBytes, 80 tracks, 3,5 Inch
  19.         CH = Lower 8 bits of maximum cylindernumber
  20.         CL = bits 6-7 : Highest 2 bits of maximum cylindernumber
  21.              bits 0-5 : Maximum sectornumber
  22.         DH = Maximum headnumber
  23.         DL = Number of connected drives
  24.         ES:DI = Pointer to disk drive parameter table
  25.  
  26.         if failed
  27.         ---------
  28.         Carry is set
  29.         AH = errorstatus
  30.  
  31. As you can see, you must do more to get the cylindernumber. Here's a little
  32. pascal code :
  33. }
  34.  
  35. Uses
  36.   Dos;
  37.  
  38. Const
  39.   DriveTypes : Array[0..4] of String[18] = ('Harddisk          ',
  40.                                             '360 kB - 5.25 Inch',
  41.                                             '1.2 MB - 5.25 Inch',
  42.                                             '720 kB - 3.5 Inch ',
  43.                                             '1.44 MB - 3.5 Inch');
  44. Var
  45.   Regs      : Registers;
  46. begin
  47.   Regs.AH := $08;
  48.   Regs.DL := $80;
  49.   Intr($13, Regs);
  50.  
  51.   WriteLn ('DriveType : ', DriveTypes[Regs.BL]);
  52.   WriteLn ('Cylinders : ', 256 * (Regs.CL SHR 6) + Regs.CH + 1);
  53.   WriteLn ('Sectors   : ', Regs.CL and $3F);
  54.   WriteLn ('Heads     : ', Regs.DH + 1);
  55.  
  56. end.
  57. {
  58. This will give you the right information from your diskdrives. I noticed that
  59. my harddisks will always be reported as driveType 0 (zero). I don't know for
  60. sure if that is documented, but it seems to be logical ;-).
  61. }